﻿using GSOrganization.Application;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Security.Claims;
using System.Text;

namespace GSOrganization.Web.Entry.Controllers
{

    [AllowAnonymous]
    public class LoginController : Controller
    {
        private static IConfiguration _config = null; 
  
        public LoginController(IConfiguration configuration )
        {
            _config = configuration;
            
        }
        /// <summary>
        /// 用户登录
        /// </summary>
        /// <returns></returns>
        public IActionResult Index()
        {
            return View();
        }
 
        /// <summary>
        /// 退出
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [Microsoft.AspNetCore.Authorization.AllowAnonymous]//不进行权限校验
        public ActionResult LogOff()
        {
            return RedirectToAction("Index", "Account");
        }
        /// <summary>
        /// 没有权限，权限校验不通过
        /// </summary>
        /// <returns></returns>
        [Microsoft.AspNetCore.Authorization.AllowAnonymous]//不进行权限校验
        public ActionResult Nopermission()
        {
            return BadRequest();
        }

        
    }

}
